import Vue from 'vue'
import Router from 'vue-router'
import Home from '@components/Home/Home'
import Member from '@components/Member/Member'
import Search from '@components/Search/Search'
import Shopcart from '@components/Shopcart/Shopcart'
import NewsList from '@components/News/NewsList'
import NewsDetail from '@components/News/NewsDetail'
import PhotoShare from  '@components/Photo/PhotoShare'

//注册全局组件router-view router-link
//未来所有的组件中的this对象，就具备该属性，所有的this其实就是vue的自雷对象

Vue.use(Router)

export default new Router({
  routes: [
  	//重定向，刷新进入首页
	  {
		  path: '/',
		  //或者redirect:'/home '
		 redirect:{name:'home'}
	  },
  	//首页
    {
      path: '/home',
      name: 'home',
      component: Home
    },
	  //会员
	  {
		  path: '/member',
		  name: 'member',
		  component: Member
	  },
	  //购物车
	  {
		  path: '/shopcart',
		  name: 'shopcart',
		  component: Shopcart
	  },
	  //查找
	  {
		  path: '/search',
		  name: 'search',
		  component: Search
	  },
	  //新闻列表
	  {
		  path: '/News/NewsList',
		  name: 'news.list',
		  component: NewsList
	  },
	  //新闻详情
	  {
	  	path:'/News/NewsDetail',
		  name:'news.detail',
		  component:NewsDetail
	  },
	  //图文列表
	  {
	  	path:'/Photo/PhotoShare',
		  name:'photo.share',
		  component:PhotoShare
	  }
  ]
})
